<template>
  <h1 class="title animate__animated  animate__lightSpeedInLeft">服务支持</h1>
  <div class="line animate__animated animate__lightSpeedInRight">
    <p style="text-align: left; margin-left: 60px;">您所在的位置：首页>服务支持>{{locationText}}</p>
  </div>
  <div
    class="animate__animated  animate__lightSpeedInLeft"
    style="display: flex; justify-content: center;"
  >
    <el-row :gutter="24" class="tab-row">
      <el-col :span="24" :sm="8" class="tab-col">
        <div
          class="page_head_leaf"
          @click="planDate"
        >方案沟通预约</div>
      </el-col>
      <el-col :span="24" :sm="8" class="tab-col">
        <div
          class="page_head_leaf"
          @click="productDate"
        >产品设计预约</div>
      </el-col>
      <el-col :span="24" :sm="8" class="tab-col">
        <div
          class="page_head_leaf"
          @click="afterSaleDate"
        >售后服务预约</div>
      </el-col>
    </el-row>
  </div>
  <div style="padding:20px" class="form-container">
    <component :is="currentComponent" />
  </div>
</template>

<script>
import ConsultForm from "@/components/ConsultDate.vue";
import DesignForm from "@/components/ProductDesign.vue";
import ServiceForm from "@/components/AfterSale.vue";
export default {
  components:{
    ConsultForm,
    DesignForm,
    ServiceForm
  },
  data() {
    return {
      locationText: "方案沟通预约",
      currentComponent: ConsultForm,
    };
  },
  methods: {
    planDate() {
      this.currentComponent = "ConsultForm";
      this.locationText = "方案沟通预约";
    },
    productDate() {
      this.currentComponent = "DesignForm";
      this.locationText = "产品设计预约";
    },
    afterSaleDate() {
      this.currentComponent = "ServiceForm";
      this.locationText = "售后服务预约";
    },
  },
};
</script>

<style scoped>
.title {
  font-size: 60px;
  text-align: left;
  margin-left: 60px;
}

.line {
  height: 50px;
  background: linear-gradient(to right, white, 60%, rgb(217, 215, 215));
}

.page_head_leaf {
  padding: 22px 30px;
  border-radius: 6px;
  display: inline-block;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  width: calc(100% - 60px);
  margin: 0 30px 10px 30px;
}

.page_head_leaf:hover {
  background-color: red;
  color: white;
}

.tab-row {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.tab-col {
  display: flex;
  justify-content: center;
}

.form-container {
  padding: 20px;
  box-sizing: border-box;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

::v-deep .el-form-item__label {
  font-size: 20px;
}

/* 平板及以上设备保持原有样式 */
@media (min-width: 768px) {
  .page_head_leaf {
    padding: 22px 30px;
    display: inline-block;
    margin: 0;
    width: auto;
  }
  
  .tab-col {
    display: block;
  }
}

/* 小屏幕优化 */
@media (max-width: 767px) {
  .title {
    font-size: 2.5rem;
    margin-left: 20px;
  }
  
  .line p {
    margin-left: 20px;
    font-size: 0.9rem;
  }
  
  .form-container {
    padding: 15px;
  }
  
  ::v-deep .el-form-item__label {
    font-size: 1rem;
  }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
  .title {
    font-size: 2rem;
    margin-left: 15px;
  }
  
  .line {
    height: auto;
    min-height: 50px;
    display: flex;
    align-items: center;
  }
  
  .line p {
    margin-left: 15px;
    font-size: 0.8rem;
    padding: 10px 0;
  }
  
  .page_head_leaf {
    padding: 15px 20px;
    font-size: 0.9rem;
    margin: 0 15px 10px 15px;
    width: calc(100% - 30px);
  }
  
  .form-container {
    padding: 10px;
  }
  
  ::v-deep .el-form-item__label {
    font-size: 0.9rem;
  }
}
</style>